import { defineConfig } from 'umi';
import { join } from 'path';
import defaultSettings from './defaultSettings';
import routes from './routes';

export default defineConfig({
  layout: {
    // 默认使用 Ant Design 的 ProLayout
    // https://umijs.org/zh-CN/plugins/plugin-layout
    // https://procomponents.ant.design/components/layout#prolayout
    locale: false,
    ...defaultSettings,
  },
  hash: true,
  dva: {
    // 是否启用 dva model 的热更新
    hmr: true,
    immer: true,
  },
  history: {
    type: 'browser',
  },
  routes: routes,
  fastRefresh: {},
  openAPI: {
    requestLibPath: "import { request } from 'umi'",
    // 或者使用在线的版本
    // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json",
    schemaPath: join(__dirname, 'api.json'),
    mock: false,
  },
  webpack5: {},
});
